import React from 'react'
import { Outlet, Navigate, useLocation } from 'umi'
import { isLogin } from '@/utils'
export default function auth() {
  const location = useLocation();
  return (
    <div>
      {
        isLogin()
        ?
        <Outlet/>
        :
        <Navigate to="/login" state={{from: location}}/>
      }
      
    </div>
  )
}
